package com.xujianlun.cpms.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xujianlun.cpms.dto.RecordDto;
import com.xujianlun.cpms.entity.Record;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.sql.ResultSet;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xujianlun
 * @since 2022-12-21
 */
@Mapper
public interface RecordMapper extends BaseMapper<Record> {

    @Select("select 1 from t_record where add_time < (CURDATE()+1)  and add_time>CURDATE() and user_id=#{userId}")
    Integer check(@Param("userId") Integer userId);

    Page<RecordDto> findPageByLocale(Page<Record> recordDtoPage, @Param("name") String name, @Param("locale") String locale, @Param("userId") Integer userId,@Param("localName") String localName);
}
